package com.sxdz.controller.service.order

import com.sxdz.controller.mapper.TOrderDetailMapper
import com.sxdz.controller.service.BaseService
import com.sxdz.models.TOrderDetail
import groovy.transform.CompileStatic
import groovy.transform.TypeChecked
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

/**
 * Created by LiYan on 2016/8/3.
 */
@Service
@CompileStatic
@TypeChecked
class OrderDetailService extends BaseService implements IOrderDetailService{
    @Autowired
    private TOrderDetailMapper tOrderDetailMapper;

    @Override
    Long addBasic(def obj) throws Exception {
        tOrderDetailMapper.insertSelective((TOrderDetail)obj)
    }

    @Override
    void modifyBasic(def obj) throws Exception {}

    @Override
    void delBasic(def obj) throws Exception {}

    TOrderDetail findObj(Map<String, Object> params){
        return tOrderDetailMapper.selectByParams(params)
    }

    List<TOrderDetail> findListByParams(Map<String, Object> params){
        return tOrderDetailMapper.selectListByParams(params,null,null,null)
    }

    @Override
    int deleteOrder(Long orderId) {
        return tOrderDetailMapper.deleteOrder(orderId)
    }
}
